import request from '@/utils/request'

export function getBannersByGroupId(groupId) {
    return request({
        url: `/cms/banner/getBannersByGroupId/${groupId}`,
        method: 'get',
    })
}

export function updateBanners(banners) {
    return request({
        url: `/cms/banner/updateBanners`,
        method: 'post',
        data: banners
    })
}

export function saveBanner(banner) {
    return request({
        url: `/cms/banner/saveBanner`,
        method: 'put',
        params: { ...banner }
    })
}

export function getBannerById(id) {
    return request({
        url: `/cms/banner/getBannerById/${id}`,
        method: 'get',
    })
}


export function deleteBannerByIds(ids) {
    return request({
        url: `/cms/banner/deleteBannerByIds`,
        method: 'post',
        data: ids
    })
}

export function refreshChangedShowBanner(){
    return request({
        url: `/cms/banner/refreshChangedShowBanner`,
        method: 'post',
    })
}